This relates generally to graphics processing.
A pixel shader dispatch uses a pixel shader scoreboard to maintain an order of critical sections of threads. A pixel shader dispatch sends quads of pixels through quad pixel shader units, processing pixel shader passes for all quads in a batch. A thread critical section is a part of a thread that requires ordering for data consistency. A critical section needs to wait for the result from a result producing thread to complete execution of that critical section.
A pixel shader scoreboard uses coordinates corresponding to corners of pixel quads. For example a scoreboard could use eight x,y coordinates of eight upper left corners of quads of 2×2 pixel blocks sometimes called subspans.
Presently only one critical section is allowed per thread. When dispatching a pixel shader thread, each quad's x,y coordinates may be used to generate a unique scoreboard address which is equal to hash_func(x,y). Also each pixel shader thread may have a unique pixel shader thread identifier. A thread dependency register may be used to keep track of the thread that each quad is dependent on. For example, if there are eight pixel quads, then there are eight such dependencies, and there may be eight thread dependency registers for each pixel shader thread. A thread dependency register may record a valid pixel shader thread identifier to indicate what thread a quad depends on. Normally an active thread dependency register has a valid bit set for that register.
When previous threads retire because their critical sections have been fully executed, guaranteeing a correct order of the dependent pixel shader thread, the thread dependency register is cleared. The dependent pixel shader thread may then wait until all the thread dependency registers are cleared before executing a critical section.
There are cases when a system for graphics processing changes the hash function (hash_func) to generate the scoreboard address or there is a change in the interpretation of the address coordinates. One example is a decoupled pixel shader whose shading ratio causes a change in the x,y coordinates and potentially in the hash function. If the shading or ratio changes on a per triangle basis, an inefficiency may be introduced into the system.
When the hash function changes, tracking dependency based on the scoreboard mechanism creates hazards such as not marking a true dependency or marking a false dependency. These hazards may result in incoherent data. In order to avoid these hazards, one could stall the scoreboard lookup stage until all threads retire before changing the scoreboard hash function or changing the x,y space. But this stall creates an inefficiency in feeding the execution units and a loss in performance or wasted power. When the hash function or x,y space changes often, such a stall can create a performance breakdown point.